package com.zy.ai.tools;

import com.mybatisflex.core.query.QueryWrapper;
import com.zy.entity.Project;
import com.zy.service.IProjectService;
import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @InterfaceName: TestTools
 * @Description:
 * @Author: zhangyan
 * @Date: 2025-09-03 18:11
 **/
@Slf4j
@Component
public class TestTools {
    @Autowired
    private IProjectService projectService;


    @Tool("获取项目列表")
    public List<Project> getProjectList() {
        return projectService.list();
    }
    @Tool("根据项目编号查询项目信息")
    public Project getProject(@P("招标项目编号") String tenderNo) {
        QueryWrapper queryWrapper = new QueryWrapper().eq(Project::getTenderNo, tenderNo);
        return projectService.getOne(queryWrapper);
    }


}
